<?php

namespace App\Http\Controllers\Home;



use App\Http\Controllers\Controller;
use App\Models\Contract;
use Dcat\Admin\Admin;
use Dcat\Admin\Layout\Content;
use Dcat\Admin\Widgets\Card;
use Dcat\Admin\Widgets\Markdown;
use Illuminate\Http\Request;
use Illuminate\Support\Str;
use function AlibabaCloud\Client\json;

class ContractShowController extends Controller
{
    public function show(Request $request)
    {

        $code=strtoupper($request->code);
        $contract=Contract::where('code',$code)->first();
        if(!$contract){
            abort(404,'合同不存在');
        }
        //将$html输出到页面
        return view('contract',['html'=>$contract]);
    }

}
